package indi.gtl.superbrain.fragment;

import java.util.ArrayList;
import java.util.List;

import indi.gtl.superbrain.adapter.GameTryAdapter;
import indi.gtl.superbrain.models.UserInfo;
import indi.gtl.superbrain.R;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.GridView;

public class MainThirdFragment extends Fragment{
	List<UserInfo>list;
	UserInfo info;
	GameTryAdapter adapter;
	GridView gridView;
	int img[]={R.drawable.ic_launcher,R.drawable.ic_launcher,R.drawable.ic_launcher,R.drawable.ic_launcher};
	String name[]={"С������","���׼���","����ʯͷ��","������"};
@Override
public void onCreate(Bundle savedInstanceState) {
	// TODO Auto-generated method stub
	super.onCreate(savedInstanceState);
}
@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View view=inflater.inflate(R.layout.main_third_layout, null);
		
		gridView=(GridView) view.findViewById(R.id.show_game);
		list=new ArrayList<UserInfo>();
		for (int i = 0; i < img.length; i++) {
			info=new UserInfo();
			info.name = name[i];
			info.head = img[i];
			list.add(info);
		}
		adapter=new GameTryAdapter(list, getActivity());
		gridView.setAdapter(adapter);
		return view;
	}
}
